import apiClient from "../../apiClient";

import type { Organization } from "#/entity";
import type { Result } from "#/api";


const findById = (id: string) => apiClient.get<Organization>({ url: `/sys/org/${id}` });
const queryAll = () => apiClient.get<Result<Organization[]>>({url: "/sys/org/all"});
const add = (data: Organization) => apiClient.post<Organization>({ url: "/sys/org/add", data });
const update = (data: Organization) => apiClient.post<Organization>({ url: "/sys/org/edit", data });
const deleteById = (id: string) => apiClient.delete({ url: `/sys/org/${id}` });

export default {
  queryAll,
	findById,
	add,
	update,
  deleteById
};